#include "mainpage.h"
#include "imformation.h"
#include "upload.h"
#include "mainwindow.h"
#include "ui_mainpage.h"
#include "shop.h"
#include "shop1.h"
#include "shop2.h"

mainpage::mainpage(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::mainpage)
{
    ui->setupUi(this);
    QPixmap *pix = new QPixmap(":/mainphoto/mianphoto.jpg");
    ui->pushButton_shop1->close();
    ui->pushButton_shop2->close();
    ui->pushButton_shop3->close();
    QSize sz = ui->label_image->size();
    ui->label_image->setPixmap(pix->scaled(sz));
}

mainpage::~mainpage()
{
    delete ui;
}

void mainpage::on_pushButton_3_clicked()
{
    imformation *w = new imformation;
    w->show();
    this->close();
}

void mainpage::on_pushButton_clicked()
{
    QPixmap *pix = new QPixmap(":/shopphoto/shop1.jpg");
    QSize sz = ui->label_image->size();
    ui->label_shop1->setPixmap(pix->scaled(sz));
    QPixmap *pix1 = new QPixmap(":/shopphoto/shop2.jpg");
    QSize sz1 = ui->label_image->size();
    ui->label_shop2->setPixmap(pix1->scaled(sz1));
    QPixmap *pix2 = new QPixmap(":/shopphoto/shop3.jpg");
    QSize sz2 = ui->label_image->size();
    ui->label_shop3->setPixmap(pix2->scaled(sz2));
    ui->label_shop1_1->setText("售价:12元");
    ui->label_shop2_1->setText("售价:1599元");
    ui->label_shop3_1->setText("售价:99元");
    ui->pushButton_shop1->show();
    ui->pushButton_shop2->show();
    ui->pushButton_shop3->show();
}


void mainpage::on_pushButton_2_clicked()
{
    upload *w = new upload;
    w ->show();
    this ->close();
}

void mainpage::on_pushButton_4_clicked()
{
    MainWindow *q=new MainWindow;
    q -> show();
    this ->close();
}

void mainpage::on_pushButton_shop1_clicked()
{
    shop *w = new shop;
    w ->show();
    this ->close();
}


void mainpage::on_pushButton_shop2_clicked()
{
    shop1 *w = new shop1;
    w ->show();
    this ->close();
}

void mainpage::on_pushButton_shop3_clicked()
{
    shop2 *w = new shop2;
    w ->show();
    this ->close();
}
